# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-html-similarity
pkgname=('python2-html-similarity' 'python-html-similarity')
_pkgname=html-similarity
pkgver=0.3.3
pkgrel=6
pkgdesc='A set of similarity metricts to compare html files.'
arch=('any')
url='https://pypi.org/project/html-similarity/#files'
license=('BSD')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('1ad7e0afbcdf41cf6085c8c893d0a5cd63eaa944947014dc572b4a795f34ff724f07cb466411f24c6d1c9b8a1ede51428c959ef9dc6ef8a7608c6d839f57a04d')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-html-similarity() {
  depends=('python2' 'python2-parsel')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-html-similarity() {
  depends=('python' 'python-parsel')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

